package com.ruoyi.comprehensive.service.impl;

import com.ruoyi.comprehensive.service.ICodeService;
import com.ruoyi.comprehensive.vo.CodeVo;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Service
public class CodeServiceImpl implements ICodeService {
    /**
     * 获取编码
     * @param vo
     * @return
     */
    @Override
    public String getDustPreventionCode(CodeVo vo) {
        //获取当前时间
        String formattedDate = LocalDateTime.now().format(DateTimeFormatter.BASIC_ISO_DATE);
        String result = vo.getPrefix() + formattedDate + "00" + vo.getClickCount();
        return result;
    }
}
